package leetcode.D100.T9;

/**
 * @File Info: leetcode -- <Solution>
 * @Author: DYZ
 * @Create: 2021-08-08 21:02:39 星期日
 */

public class Solution {
    public boolean isPalindrome(int x) {
        if(x < 0) {
            return false;
        }
        int a = x;
        long b = 0L;
        while(a > 0) {
            int bit = a % 10;
            a /= 10;
            b = b * 10 + bit;
            if(b > Integer.MAX_VALUE) {
                return false;
            }
        }
        return b == (long) x;
    }
}
